package Test

import org.apache.spark.util.AccumulatorV2
import org.apache.spark.{SparkConf, SparkContext}

object MyAcc {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf()
    conf.setMaster("local")
    conf.setAppName("map")
    val context = new SparkContext(conf)
    val src = context.textFile("spark/data/students.csv")
    val wordcount = context.longAccumulator("wordcount")
    src.map(line => {
      val sp = line.split(",")
      sp
    })

  }
  class MyAccumulator extends AccumulatorV2[Long,Long]{
    override def isZero: Boolean = ???

    override def copy(): AccumulatorV2[Long, Long] = ???

    override def reset(): Unit = ???

    override def add(v: Long): Unit = ???

    override def merge(other: AccumulatorV2[Long, Long]): Unit = ???

    override def value: Long = ???
  }
}
